package com.yanqu.road.entity.activity.zhenhuan.firstProcess;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_zhenhuan_first", desc = "甄嬛传第一阶段数据")
public class UserZhenHuanFirstProcessData extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(select = true, update = true, desc = "用户id")
    private long userId;
    @FieldTypeAnnotation(desc = "体力")
    private int power;
    @FieldTypeAnnotation(desc = "体力恢复时间戳")
    private long powerRecoverTime;
    @FieldTypeAnnotation(desc = "积分")
    private int score;
    @FieldTypeAnnotation(desc = "轮次")
    private int round;
    @FieldTypeAnnotation(desc = "内定的故事id")
    private int storyId;
    @FieldTypeAnnotation(desc = "已选数据 位置-妃子id")
    private Map<Integer, Integer> choseMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "已解锁故事 key=storyId value=累计次数")
    private Map<Integer, Integer> unlockStory = new HashMap<>();
    @FieldTypeAnnotation(desc = "点赞记录")
    private boolean isWorship;
    @FieldTypeAnnotation(desc = "触发保底前累计")
    private int specialAmount;


    public UserZhenHuanFirstProcessData() {
    }

    public UserZhenHuanFirstProcessData(int activityId, long userId) {
        this.activityId = activityId;
        this.userId = userId;
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
        setUpdateOption();
    }

    public long getPowerRecoverTime() {
        return powerRecoverTime;
    }

    public void setPowerRecoverTime(long powerRecoverTime) {
        this.powerRecoverTime = powerRecoverTime;
        setUpdateOption();
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
        setUpdateOption();
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        this.round = round;
        setUpdateOption();
    }

    public int getStoryId() {
        return storyId;
    }

    public void setStoryId(int storyId) {
        this.storyId = storyId;
        setUpdateOption();
    }

    public Map<Integer, Integer> getChoseMap() {
        return choseMap;
    }

    public void setChoseMap(Map<Integer, Integer> choseMap) {
        this.choseMap = choseMap;
        setUpdateOption();
    }

    public Map<Integer, Integer> getUnlockStory() {
        return unlockStory;
    }

    public void setUnlockStory(Map<Integer, Integer> unlockStory) {
        this.unlockStory = unlockStory;
    }

    public boolean isWorship() {
        return isWorship;
    }

    public void setWorship(boolean worship) {
        isWorship = worship;
        setUpdateOption();
    }

    public void putChoseMap(int position, int concubineId) {
        choseMap.put(position, concubineId);
        setUpdateOption();
    }

    public void addUnlockStory(int storyId) {
        if (unlockStory.containsKey(storyId)) {
            unlockStory.put(storyId, unlockStory.get(storyId) + 1);
        } else {
            unlockStory.put(storyId, 1);
        }
        this.specialAmount++;
        setUpdateOption();
    }

    public int getSpecialAmount() {
        return specialAmount;
    }

    public void setSpecialAmount(int specialAmount) {
        this.specialAmount = specialAmount;
        setUpdateOption();
    }
}
